﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Common;
using DataAccess;

/// <summary>
/// Summary description for InsertCandidate
/// </summary>
public class InsertCandidate
{
	public InsertCandidate()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public bool AddCandidate(Candidate candidate)
    {
        bool result = false;
        DbCommand cmd = GenericData.CreateCommand();
        cmd.CommandText = "INSERT INTO Candidate(Username, Password, Fullname, Email, Mobile, Address, Certificate, Experience) VALUES('" + candidate.Username + "', '" + candidate.Password + "', '" + candidate.Fullname + "', '" + candidate.Email + "', '" + candidate.Mobile + "', '" + candidate.Address + "', '" + candidate.Certificate + "', '" + candidate.Experience + "')";
        if (GenericData.ExecuteNoneQuery(cmd) > 0)
            result = true;
        return result;
    }
}